using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MovementController : MonoBehaviour
{
    public float movementSpeed=3.0f;
    Vector2 movement=new Vector2();
    Rigidbody2D rb2D;
    // Start is called before the first frame update
    void Start()
    {
        rb2D=GetComponent<Rigidbody2D>();
    }

    // Update is called once per frame
    void Update()
    {
         
    }
    void FixedUpdate()
    {
     movement.x=Input.GetAxis("Horizontal");
     movement.y=Input.GetAxis("Vertical");
     movement.Normalize();
          rb2D.velocity=movement* movementSpeed;     
    }
}
